<?php
declare (strict_types = 1);

namespace app\middleware;

use think\Request;
use app\api\service\UserToken;
/**
 * 验证token中间件
 * Class ApiToken
 * @package app\api\middleware
 */
class ApiToken
{
    public function handle(Request $request, \Closure $next)
    {
        if($request->param('code')){
            return $next($request);
        }
        UserToken::checkAccessMustHasToken();
        return $next($request);
    }

}
